package com.gmi.rnaseqwebapp.client.ui;

import com.google.gwt.user.client.ui.RequiresResize;
import com.google.gwt.visualization.client.AbstractDataTable;
import com.google.gwt.visualization.client.visualizations.corechart.BarChart;
import com.google.gwt.visualization.client.visualizations.corechart.Options;

public class ResizeableBarChart extends BarChart implements RequiresResize {

	
	protected Options options;
	protected AbstractDataTable data;
	
	public ResizeableBarChart(AbstractDataTable data, Options options) {
		super(data, options);
		this.data = data;
		this.options = options;
		
	}

	@Override
	public void onResize() {
		options.setWidth(getParent().getOffsetWidth());
		options.setHeight(getParent().getOffsetHeight());
		draw(data, options);
	}
	
	public void draw2(AbstractDataTable data,Options options) {
		this.options = options;
		this.data = data;
		draw(data,options);
	}

}
